<?php
/* Smarty version 3.1.31, created on 2018-06-19 22:59:41
  from "D:\wamp64\www\wanju\views\commission\index.html" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.31',
  'unifunc' => 'content_5b291a5daf7349_34083429',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '0203160ea3445bd90ccdbe0d323a056e539455dd' => 
    array (
      0 => 'D:\\wamp64\\www\\wanju\\views\\commission\\index.html',
      1 => 1529420371,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5b291a5daf7349_34083429 (Smarty_Internal_Template $_smarty_tpl) {
?>

  <div class="x_panel">
    <div class="x_content" style="display: block;">
      <div class="nav navbar-left panel_toolbox">
        <form action="" method="post">
        <input type="text"  name="form[start_time]" value="<?php if (isset($_smarty_tpl->tpl_vars['start_time']->value)) {
echo $_smarty_tpl->tpl_vars['start_time']->value;
}?>" placeholder="时间" id="J_dh_start" class="form-control-new" >
        <select class="form-control-area" name="form[shop_id]">
          <option value="<?php if (isset($_smarty_tpl->tpl_vars['selshop']->value)) {
echo $_smarty_tpl->tpl_vars['selshop']->value['shop_id'];
} else { ?>0<?php }?>"><?php if (isset($_smarty_tpl->tpl_vars['selshop']->value)) {
echo $_smarty_tpl->tpl_vars['selshop']->value['shop_name'];
} else { ?>请选择<?php }?></option>
          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['shop']->value, 'value', false, 'key');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['value']->value) {
?>
          <option value="<?php echo $_smarty_tpl->tpl_vars['value']->value['shop_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['value']->value['shop_name'];?>
</option>
          <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
?>

        </select>
        <select class="form-control-area" name="form[province_id]" id="zone1">
          <option value="<?php if (isset($_smarty_tpl->tpl_vars['selprovince']->value)) {
echo $_smarty_tpl->tpl_vars['selprovince']->value['region_code'];
} else { ?>0<?php }?>"><?php if (isset($_smarty_tpl->tpl_vars['selprovince']->value)) {
echo $_smarty_tpl->tpl_vars['selprovince']->value['region_name'];
} else { ?>请选择<?php }?></option>
          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['province']->value, 'value', false, 'key');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['value']->value) {
?>
          <option value="<?php echo $_smarty_tpl->tpl_vars['value']->value['region_code'];?>
"><?php echo $_smarty_tpl->tpl_vars['value']->value['region_name'];?>
</option>
          <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
?>

        </select>
        <label class="control-label w50">省</label>

        <select class="form-control-area" name="form[city_id]" id="zone2">
          <option value="<?php if (isset($_smarty_tpl->tpl_vars['selcity']->value)) {
echo $_smarty_tpl->tpl_vars['selcity']->value['region_code'];
} else { ?>0<?php }?>"><?php if (isset($_smarty_tpl->tpl_vars['selcity']->value)) {
echo $_smarty_tpl->tpl_vars['selcity']->value['region_name'];
} else { ?>请选择<?php }?></option>
        </select>
        <label class="control-label w50">市</label>

        <select class="form-control-area" name="form[district_id]" id="zone3">
          <option value="<?php if (isset($_smarty_tpl->tpl_vars['seldistrict']->value)) {
echo $_smarty_tpl->tpl_vars['seldistrict']->value['region_code'];
} else { ?>0<?php }?>"><?php if (isset($_smarty_tpl->tpl_vars['seldistrict']->value)) {
echo $_smarty_tpl->tpl_vars['seldistrict']->value['region_name'];
} else { ?>请选择<?php }?></option>
        </select>
        <label class="control-label w50">区</label>

        <select class="form-control-area" name="form[street_id]" id="zone4">
          <option value="<?php if (isset($_smarty_tpl->tpl_vars['selstreet']->value)) {
echo $_smarty_tpl->tpl_vars['selstreet']->value['region_code'];
} else { ?>0<?php }?>"><?php if (isset($_smarty_tpl->tpl_vars['selstreet']->value)) {
echo $_smarty_tpl->tpl_vars['selstreet']->value['region_name'];
} else { ?>请选择<?php }?></option>
        </select>
        <label class="control-label w50">街道</label>
        <button class="btn btn-primary" type="submit">搜索</button>
        </form>
      </div>
      <br><br>
      <div class="cont">
        <table class="table table-bordered table-striped">
          <thead>
          <tr>
            <th width="100px">序号</th>
            <th>商家名称</th>
            <th>账号</th>
            <th>角色</th>
            <th>入场券订单分佣</th>
            <th>会员卡订单分佣</th>
            <th>商品订单出售分佣</th>
            <th>商品订单回收分佣</th>
          </tr>
          </thead>
          <tbody id="result">
          <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['commission']->value, 'commissionitem', false, 'key');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['key']->value => $_smarty_tpl->tpl_vars['commissionitem']->value) {
?>
          <tr>
            <td><?php echo $_smarty_tpl->tpl_vars['key']->value+1;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['commissionitem']->value['shop_name'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['commissionitem']->value['phone'];?>
</td>
            <td><?php if ($_smarty_tpl->tpl_vars['commissionitem']->value['type'] == 1) {?>店主<?php } else { ?>店长<?php }?></td>
            <td><?php if (isset($_smarty_tpl->tpl_vars['commissionitem']->value['quan'])) {
echo $_smarty_tpl->tpl_vars['commissionitem']->value['quan'];?>
元<?php } else { ?>0元<?php }?></td>
            <td><?php if (isset($_smarty_tpl->tpl_vars['commissionitem']->value['card'])) {
echo $_smarty_tpl->tpl_vars['commissionitem']->value['card'];?>
元<?php } else { ?>0元<?php }?></td>
            <td><?php if (isset($_smarty_tpl->tpl_vars['commissionitem']->value['sale_goods'])) {
echo $_smarty_tpl->tpl_vars['commissionitem']->value['sale_goods'];?>
元<?php } else { ?>0元<?php }?></td>
            <td><?php if (isset($_smarty_tpl->tpl_vars['commissionitem']->value['recovery_goods'])) {
echo $_smarty_tpl->tpl_vars['commissionitem']->value['recovery_goods'];?>
元<?php } else { ?>0元<?php }?></td>
          </tr>
          <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);
?>

          </tbody>
        </table>
      </div>
    </div>
  </div>

  <?php echo '<script'; ?>
 type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['theme']->value;?>
/libs/js/datepicker/bootstrap-datetimepicker.min.js"><?php echo '</script'; ?>
>
  <?php echo '<script'; ?>
>
      var startDate = $('#J_dh_start').datetimepicker({
          format: "yyyy-MM",
          autoclose: true,
          todayBtn: true,
          minView: 2,
      })/*.on('changeDate', function(ev) {
          //var evDate = ev.date.getFullYear() + '-' + (ev.date.getMonth() + 1) + '-' + ev.date.getDate();
          //$('#J_dh_end').datetimepicker('setStartDate', evDate);
          start_time = $(this).val();
          var url = "<?php echo U(array('commission/index'));?>
";
          $.post(url, 'start_time='+start_time, function (data) {
              $('#result').html('');
              $.each(data, function(i,val){
                  key = i+1;
                  html = "<tr>";
                  html += "<td>"+key+"</td>";
                  html += "<td>"+val.shop_name+"</td>";
                  html += "<td>"+val.phone+"</td>";
                  if(val.type==1){
                      html += "<td>店主</td>";
                  }else{
                      html += "<td>店长</td>";
                  }
                  if(val.quan){
                      html += "<td>"+val.quan+"元</td>";
                  }else{
                      html += "<td>0元</td>";
                  }
                  if(val.card){
                      html += "<td>"+val.card+"元</td>";
                  }else{
                      html += "<td>0元</td>";
                  }
                  if(val.sale_goods){
                      html += "<td>"+val.sale_goods+"元</td>";
                  }else{
                      html += "<td>0元</td>";
                  }
                  if(val.recovery_goods){
                      html += "<td>"+val.recovery_goods+"元</td>";
                  }else{
                      html += "<td>0元</td>";
                  }

                  html += "</tr>";
                  $('#result').append(html)
              });
          },'json');

      });*/


      $('#zone1').change(function (e) {
          var zoneid = this.value;
          var url = "<?php echo U(array('area/getzone'));?>
";
          $.post(url, 'zoneid='+zoneid, function (data) {
              $('#zone2').html('');
              for(var i=0; i<data.length; i++){
                  $('#zone2').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
              }
              $.post(url, 'zoneid='+data[0].region_code, function (data1) {
                  $('#zone3').html('');
                  for(var i=0; i<data1.length; i++){
                      $('#zone3').append("<option value= '"+data1[i].region_code+"'>"+data1[i].region_name+"</option>");
                  }
                  $.post(url, 'zoneid='+data1[0].region_code, function (data2) {
                      $('#zone4').html('');
                      for(var i=0; i<data2.length; i++){
                          $('#zone4').append("<option value= '"+data2[i].region_code+"'>"+data2[i].region_name+"</option>");
                      }
                      $('#street_id').val(data2[0].region_code);
                      $('#remark').val(data2[0].remark);
                  },'json');
              },'json');

          },'json');
      })
      $('#zone2').change(function (e) {
          var zoneid = this.value;
          var url = "<?php echo U(array('area/getzone'));?>
";
          $.post(url, 'zoneid='+zoneid, function (data) {
              $('#zone3').html('');
              for(var i=0; i<data.length; i++){
                  $('#zone3').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
              }
              $.post(url, 'zoneid='+data[0].region_code, function (data1) {
                  $('#zone4').html('');
                  for(var i=0; i<data1.length; i++){
                      $('#zone4').append("<option value= '"+data1[i].region_code+"'>"+data1[i].region_name+"</option>");
                  }
                  $('#street_id').val(data1[0].region_code);
                  $('#remark').val(data1[0].remark);
              },'json');
          },'json');
      })
      $('#zone3').change(function (e) {
          var zoneid = this.value;
          var url = "<?php echo U(array('area/getzone'));?>
";
          $.post(url, 'zoneid='+zoneid, function (data) {
              $('#zone4').html('');
              for(var i=0; i<data.length; i++){
                  $('#zone4').append("<option value= '"+data[i].region_code+"'>"+data[i].region_name+"</option>");
              }
              $('#street_id').val(data[0].region_code);
              $('#remark').val(data[0].remark);
          },'json');
      })
  <?php echo '</script'; ?>
>

<?php }
}
